import React, { useEffect, useState } from 'react';
import "../../../styles/Scorerole.scss"
import { Input, Radio, Select, Checkbox, Button, Table } from 'antd';
import { vipbiaoqian_list } from "../../../utils/vip/api"
import { useNavigate } from 'react-router-dom';


function Scorerole(props) {
    var navigate = useNavigate()

    var [data, setData] = useState([])


    //详情
    var detail = (record) => {
        console.log(record);
        navigate({ pathname: '/index/equities/vipdetail', search: `?data=${record.id}` })
    }
    useEffect(() => {
        vipbiaoqian_list().then((res) => {
            console.log(res.data);
            setData(res.data)
        })
    }, [])
    const columns = [
        {
            title: '标签名称',
            dataIndex: 'name',
        },
        {
            title: '会员数量',
            dataIndex: 'num',

        },
        {
            title: '标签类型',
            dataIndex: 'type',
        },
        {
            title: '标签条件',
            dataIndex: 'condition',
        },
        {
            title: '修改时间',
            dataIndex: 'time',

        },
        {
            title: '操作',
            dataIndex: 'price',
            render: (_, record) => (
                <>
                    <span className='iconfont icon-delete' onClick={() => { detail(record) }} style={{ color: "blue" }}>查看详情</span>
                </>
            ),
        },

    ];

    var handleChange = () => {
    }
    var onChange = () => { }
    return (
        <div className='scorerole'>
            <div className='text'>
                <span style={{ marginRight: "10px" }}>会员管理</span>/
                <span style={{ marginLeft: "10px" }}>会员标签</span>
                <h2 style={{ marginBottom: "20px" }}>会员标签</h2>
            </div>
            <div>
                <div style={{ padding: "20px" }}>标签</div>
                <Table columns={columns} dataSource={data} style={{ textAlign: "center" }} />
            </div>


        </div>
    );
}

export default Scorerole;